#pragma once
/*
 *  NxtInput.h
 *  NxtFace
 *
 *  Created by Dave on 9/9/06.
 *  Copyright 2006 __MyCompanyName__. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */

#import <Cocoa/Cocoa.h>
#import "NxtDevice.h"

namespace SBJ
{
namespace NXT
{
class Input;
}
}

enum ESensorType
{
	sensorType_none = 'ENon',
	sensorType_switch = 'ESwc',
	sensorType_tempuature = 'ETmp',
	sensorType_reflection = 'ERfl',
	sensorType_angle = 'EAng',
	sensorType_activeLight = 'EALt',
	sensorType_inactiveLight = 'EIAL',
	sensorType_DB = 'EDcb',
	sensorType_DBA = 'EDbA',
	sensorType_custom = 'ECst',
	sensorType_lowspeed = 'ELSp',
	sensorType_lowspeed9v = 'ELS9',
	sensorType_unknown = 'EUnk'
};

enum ESensorMode
{
	sensorMode_raw = 'ERaw',
	sensorMode_boolean = 'EBol',
	sensorMode_transitionCounter = 'ETrC',
	sensorMode_periodicCounterMode = 'EPCM',
	sensorMode_pctFullScaleMode = 'EFSM',
	sensorMode_celsius = 'ECel',
	sensorMode_farenheit = 'EFar',
	sensorMode_angleStepsMode = 'EASM'
};

@interface NxtInput : NSObject
{
	NxtDevice* m_device;
	SBJ::NXT::Input* m_input;
}

-(id) initInputOf: (NxtDevice*)theDevice on: (unsigned char)port;

// KVC Read-Only Attributes
- (unsigned char) Port;
- (NSString*) Name;
- (BOOL) Calibrated;
- (unsigned short) RawValue;
- (unsigned short) NormalizedValue;
- (signed short) ScaledValue;
- (signed short) CalibratedValue;

// KVC Read Attributes
- (ESensorType) Type;
- (ESensorMode) Mode;

// KVC Write Attributes
- (void) setType: (ESensorType)value;
- (void) setMode: (ESensorMode)value;

// Commands
- (void) reset;

@end
